Skip to content

Input and Output ​

Terminal Output ​

print ​

lua
print(content...)

Outputs content to the command line without a newline.

Parameters ​

ParameterTypeDescription
content...AnyContent to output. Non-text types are automatically converted to text. Multiple contents can be written, separated by ,; they will be separated by tabs when output.

println ​

lua
println(content...)

Outputs content to the command line with a newline.

Parameters ​

ParameterTypeDescription
content...AnyContent to output. Non-text types are automatically converted to text. Multiple contents can be written, separated by ,; they will be separated by tabs when output.

File ​

FileExists ​

lua
exists = FileExists(path)

Checks if a file exists and is readable.

Parameters ​

ParameterTypeDescription
pathStringFile path

Return Value ​

Return ValueTypeDescription
existsBoolWhether the file exists

FileSize ​

lua
size = FileSize(path)

Gets the size of a file.

Parameters ​

ParameterTypeDescription
pathStringFile path

Return Value ​

Return ValueTypeDescription
sizeIntegerFile size (in bytes)

ASCII File Output ​

PrintToFile ​

lua
PrintToFile(path, content...)

Writes content to the end of an ASCII file (appends, no newline added by default).

Parameters ​

ParameterTypeDescription
pathStringFile path
content...AnyContent to write. Non-text types are automatically converted to text. Multiple contents can be written, separated by ,; they will be separated by tabs when written.

WriteToFile ​

lua
WriteToFile(path, content...)

Overwrites an ASCII file and adds a newline after the content.

Parameters ​

ParameterTypeDescription
pathStringFile path
content...AnyContent to write. Non-text types are automatically converted to text. Multiple contents can be written, separated by ,; they will be separated by tabs when written.

WriteLineToFile ​

lua
WriteLineToFile(path, content...)

Overwrites an ASCII file (no additional newline added by default).

Parameters ​

ParameterTypeDescription
pathStringFile path
content...AnyContent to write. Non-text types are automatically converted to text. Multiple contents can be written, separated by ,; they will be separated by tabs when written.

ReadFromFile ​

lua
content = ReadFromFile(path)

Reads the content of an ASCII file.

Parameters ​

ParameterTypeDescription
pathStringFile path

Return Value ​

Return ValueTypeDescription
contentStringText content of the file

AI-Vision, Making 3D Measurement Easier